#ifndef _OGL_FONT_H_
#define _OGL_FONT_H_

#include "font/font.h"
// VFS
#include "vfs/vfs.h"
//#include <ft2build.h>
//#include <freetype/freetype.h>

namespace buffer
{
    class VertexBuffer;
}

class oglFont : public Font
{
public:
							oglFont( const std::string& Name );
							~oglFont();
	
	
	virtual void			Render(	const std::wstring& Text,
							const math::Vec2& Pos,
							const math::Vec2& Size = math::Vec2(1.0f, 1.0f),
							unsigned int Flags = FONT_WORDBREAK, 
							COLOR		Color = ColorRGBA(255, 255, 255),
							bool		Clip=false);

								
	virtual void			DeInit();
	virtual void			CacheGlyphs(bool	CopyRect);	
	virtual void			Recreate();
	virtual void			Resize(const std::string& _Face, int Width, int Height, int Weight, unsigned long CharSet);

protected:

	virtual GlyphData*		GetGlyphIndex(unsigned short Glyph); 
	virtual void			SetTexture();	

	inline static int		NextPowerof2 (int Num );


	int						m_CacheGlyphC;
	std::vector<GlyphData*>	m_pEmpty;
	unsigned int			m_Texture;
 	void*					m_FreeTypeFace;
	void*					m_AltFreeTypeFace;
 	int						m_QuadSize;
	vfs::LoadedBlock		m_FontData;
	vfs::LoadedBlock		m_AltFontData;

};

#endif // _ogl_FONT_H_